<template>
	<view class="content pageBg">
		<custom-nav-bar title="推荐"></custom-nav-bar>
		<swiper class="banner" circular indicator-color="rgba(255, 255, 255, 0.5)" indicator-dots="true"
			autoplay="true" interval="2000" duration="500">
			<swiper-item class="swiper-item" v-for="(item, index) in 3" :key="index">
				<image src="/common/wallpaper/banner1.jpg" mode="aspectFill" />
			</swiper-item>
		</swiper>
		<view class="notice">
			<view class="left">
				<uni-icons class="notice-icon" type="sound-filled" size="20"></uni-icons>
				<text>公告</text>
			</view>
			<view class="center">
				<swiper class="center-swiper" vertical circular autoplay interval="1500" duration="300">
					<swiper-item v-for="(item, index) in 3" :key="index">
						<navigator  :url="'/pages/notice-list/notice-list?item='+ item">
							<text>niaho3333333333333333333333333333311</text>
						</navigator>
					</swiper-item>
				</swiper>
			</view>
			<view class="right">
				<navigator  url="/pages/notice-list/notice-list">
					<uni-icons class="uni-icons" type="right" size="16" color="#333"></uni-icons>
				</navigator>
			</view>
		</view>
		<view class="select">
			<common-title>
				<template v-slot:left>
					每日推荐
				</template>
				<template v-slot:custom>
					<view class="date">
						<uni-icons type="calendar" size="18"></uni-icons>
						<uni-dateformat :date="Date.now()" format="dd号"></uni-dateformat>
					</view>
				</template>
			</common-title>
			<scroll-view class="scroll-content" scroll-x>
				<view class="box" v-for="(item, index) in 8" :key="index">
					<image src="/common/wallpaper/preview_small.webp" mode="aspectFill"/>
				</view>
			</scroll-view>
		</view>
		<view class="theme">
			<common-title>
				<template v-slot:left>
					专题精选
				</template>
				<template v-slot:custom>
					<navigator class="more" url="">More+</navigator>
				</template>
			</common-title>
			<view class="content">
				<theme-item :isMore="false" v-for="(item, index) in 8" :key="index"/>
				<theme-item :isMore="true"/>
			</view>
		</view>
	</view>
</template>

<script setup>

</script>

<style lang="scss" scoped>
	.content {
		.banner {
			width: 750rpx;
			padding: 30rpx 0;

			.swiper-item {
				width: 100%;
				height: 100%;
				padding: 0 30rpx;
				box-sizing: border-box;
				image {
					height: 100%;
					width: 100%;
					border-radius: 10rpx;
				}
			}
		}
		
		.notice {
			display: flex;
			margin: 0 auto;
			width: 690rpx;
			height: 80rpx;
			line-height: 80rpx;
			border-radius: 80rpx;
			background-color: #f9f9f9;
			.left{
				:deep() {
					.notice-icon{
						margin-left: 30rpx;
						color: $brand-theme-color !important;
					}
				}
				text {
					vertical-align: middle;
					color: $brand-theme-color;
					font-size: 28rpx;
					font-weight: 600;
				}
			}
			.center{
				flex: 1;
				padding: 0 10rpx;
				swiper{
					height: 100%;
					&-item{
						height: 100%;
						font-size: 30rpx;
						color: #666;
						white-space: nowrap;
						text-overflow: ellipsis;
						text{
							vertical-align: middle;
						}
					}
				}
			}
			.right{
				margin-right: 30rpx;
				.uni-icons{
					vertical-align: middle;
				}
			}
		}
		
		.select{
			padding-top: 50rpx;
			.date {
				color: $brand-theme-color !important;
				:deep() {
					.uni-icons{
						color: $brand-theme-color !important;
					}
				}
			}
			.scroll-content {
				width: 720rpx;
				margin-top: 30rpx;
				margin-left: 30rpx;
				white-space: nowrap;
				.box{
					width: 200rpx;
					height: 430rpx;
					display: inline-block;
					margin-right: 15rpx;
					image{
						width: 100%;
						height: 100%;
						border-radius: 12rpx;
					}
					&:last-child{
						margin-right: 30rpx;
					}
				}
			 }
		}
		
		.theme{
			padding: 50rpx 0;
			.more{
				font-size: 32rpx;
				color: #888;
			}
			.content{
				margin-top: 30rpx;
				padding: 0 30rpx;
				display: grid;
				gap: 15rpx;
				grid-template-columns: repeat(3, 1fr);
			}
		}
	}
</style>